package com.tgl

import com.tgl.handler.PongHandler
import com.tgl.router.PongRouter
import org.springframework.boot.test.context.SpringBootTest
import spock.lang.Specification

@SpringBootTest(classes = PongApplication.class)
class PongRouterTest extends Specification{

    // 测试路由构建方法-true
    def "test msgRoutes"() {
        // given块
        given: "initial conditions"
        // 设置前置条件或数据
        PongHandler pongHandler = new PongHandler();
        PongRouter pongRouter = new PongRouter();
        when: "action is performed"
        pongRouter.msgRoutes(pongHandler)

        then:
        noExceptionThrown()
    }

    // 测试路由响应
    def "test response"() {
        // given块
        given: "initial conditions"
        // 设置前置条件或数据
        PongHandler pongHandler = new PongHandler();
        PongRouter pongRouter = new PongRouter();
        when: "action is performed"
        pongRouter.msgRoutes(pongHandler)
        then:
        noExceptionThrown()
    }
}
